<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">

<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<link href="css/main.css" rel="stylesheet" type="text/css" />

<title>后台登录</title>
</head>
<body>
<input type="hidden" id="TenantId" name="TenantId" value="" />

<div class="loginWraper">
  <div id="loginform" class="loginBox">
    <form class="form form-horizontal" action="index.html" method="post">
      <div class="adm-login-zi">欢迎使用圣嘉尔后台管理系统</div>
      <div class="row cl">
        <label class="form-label col-3"><i class="Hui-iconfont">&#xe60d;</i></label>
        <div class="formControls col-8">
          <input id="username" name="" type="text" placeholder="账户" class="input-text size-L">
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-3"><i class="Hui-iconfont">&#xe60e;</i></label>
        <div class="formControls col-8">
          <input id="pwd" name="" type="password" placeholder="密码" class="input-text size-L">
        </div>
      </div>

      <div class="row">
        <div class="formControls col-8 col-offset-3">
          <label for="online">
            <input type="checkbox" name="isMemory" id="isMemory" value="1">
            下次自动登录 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="find-1.html" title="">忘记密码?</a></label>
        </div>
      </div>

      <div class="row">
        <div class="formControls col-8 col-offset-3">
          <input name="" type="button" class="btn btn-success radius size-L" onclick="login()" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
          &nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;
          <input name="" type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
        </div>
      </div>
    </form>
  </div>
</div>

<div class="footer"></div>

<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="js/cookieUtil.js"></script> 


<script type="text/javascript">

$(function(){
  //alert(getCookie("isdl"))
  //if(getCookie("isdl")=='1'){
   // window.location.href='index.html';
 // }
})

  function login(){
    var username=$("#username").val();
     var pwd =$("#pwd").val();
   //  var username="admin";
   // var pwd ="123456";
    var meo=$("#isMemory").val();
   // alert(meo);
    if(username=='' || pwd==''){
      alert("账户名密码不完整");
      return 
    }
 $.ajax( {  
     url:'/baby/sys/syslogin',// 跳转到 action  
     data:{  
               username : username,  
               password : pwd  ,
               isMemory:meo
      },  
     type:'post',  
     cache:false,  
     dataType:'json',  
     success:function(data) { 
         if(data.code =="2000" ){ 
             alert(data.message); 
             console.log(data);  
             setCookie("username",encodeURI(data.data.userName));
             // console.log(decodeURI(data.data.userName));
            window.location.href='index.html'
            // window.location.reload();   
         }else{  
              alert(data.message); 
             console.log(data);  
         }  
      }, error : function() {      
             // view("异常！");  
          alert("异常！");  
     }  
});

}


</script>
</body>
</html>